package com.ruoyi.work.mapper;

import java.util.List;

import com.ruoyi.work.domain.TbWorkOrderUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * 救援任务人员Mapper接口
 *
 * @author szm
 * @date 2025-10-21
 */
public interface TbWorkOrderUserMapper extends BaseMapper<TbWorkOrderUser> {

    @Select("select work_no, user_no, user_name, phone,user_type,dingding_id from tb_work_order_user where `status` = '1' GROUP BY user_no")
    List<TbWorkOrderUser> getWorkUserByNo();

    @Update("update tb_work_order_user set `status` = '2',update_time = now() where work_no=#{workNo}")
    void updateByWorkNo(@Param("workNo") String workNo);

    List<TbWorkOrderUser> selectByWorkNo(@Param("workNo") String workNo);
}
